home *** CD-ROM | disk | FTP | other *** search
/ United Public Domain Gold 2 / United Public Domain Gold 2.iso / utilities / pu740.dms / pu740.adf / Install < prev    next >
Text File  |  1995-03-08  |  10KB  |  493 lines

  1. ; ImageStudio Installer Utility
  2. ;
  3. ; This script is Copyright ©1995 Andy Dean and Graham Dean
  4. ;
  5.  
  6. (
  7.     ; Ask where to install it...
  8.  
  9.     (set destdir
  10.         (askdir
  11.             (prompt "Select where you would like to install "
  12.                 "ImageStudio. A drawer called 'ImageStudio' will "
  13.                 "be created here.")
  14.             (help "ImageStudio and all necessary files will be "
  15.                 "installed in the directory of your choice. You "
  16.                 "may wish to create a new directory for "
  17.                 "ImageStudio by using the 'Make New Drawer' "
  18.                 "gadget.\n\n"
  19.                 "You may install this version over your existing "
  20.                 "version of ImageStudio, but you will loose your "
  21.                 "current preference settings and some of your "
  22.                 "files may be overwritten with more recent "
  23.                 "versions. This may be undesirable if you have "
  24.                 "customised your 'Blank_isrx' file for example.")
  25.             (default @default-dest)
  26.             (disk)
  27.         )
  28.     )
  29.  
  30.     (set destdir
  31.         (tackon destdir "ImageStudio")
  32.     )
  33.  
  34.     (set @default-dest destdir)
  35.  
  36.     ; See whether this directory exists, if so warn the user
  37.  
  38.     (if (exists @default-dest) 
  39.         (
  40.             (if (= 0 (askbool
  41.                     (prompt "The 'ImageStudio' directory "
  42.                         "already exists, overwrite?")
  43.                     (help "You may stop the install to "
  44.                         "avoid overwriting your current "
  45.                         "version of ImageStudio.\n\n"
  46.                         "Continuing the install will "
  47.                         "overwrite your current files "
  48.                         "and you will loose your current "
  49.                         "preferences.")
  50.                     (choices "Yes" "Quit")
  51.                 ))
  52.  
  53.                 (
  54.  
  55.                 ; User wishes to quit
  56.  
  57.                 (exit (quiet))
  58.                 )
  59.  
  60.             )
  61.         )
  62.     )
  63.  
  64.     (message "ImageStudio will be installed in " @default-dest)
  65.  
  66.     ; Set up decompressor to work with
  67.  
  68.     (complete 0)
  69.  
  70.     (working "Setting up files...")
  71.  
  72.     (copyfiles
  73.         (source ("ImageStudio_1:"))
  74.         (dest ("ram:"))
  75.         (choices "LX" "pcefis")
  76.     )
  77.  
  78.     (working "Installing ImageStudio Program...")
  79.  
  80.     ; Create the directory if it doesn't exist
  81.  
  82.     (if (= 0 (exists @default-dest))
  83.         (
  84.             (makedir @default-dest
  85.                 (prompt "Creating 'ImageStudio' directory")
  86.                 (infos)
  87.             )
  88.         )
  89.     )
  90.  
  91.     ; Shall we install the 68020 version ?
  92.  
  93.     (set cpuversion
  94.         (askchoice
  95.             (prompt "Choose which version of ImageStudio to install "
  96.                 "based on your processor.")
  97.             (help "If you are running an Amiga A500, A600 or "
  98.                 "unexpanded A1500 or A2000 you should run the "
  99.                 "68000 version of ImageStudio.\n\n"
  100.                 "Users of Amiga A1200, A3000, A4000s or any of the "
  101.                 "above machines which have an accelerator card "
  102.                 "should use the 68020+ version of ImageStudio "
  103.                 "for increased performance.")
  104.             (choices "68000" "68020+")
  105.         )
  106.     )
  107.  
  108.     (working "Decompressing ImageStudio executable...")
  109.  
  110.     (if (= 0 cpuversion)
  111.  
  112.         ; Install the 68000 version
  113.  
  114.         (
  115.             (run ("ram:pcefis ImageStudio_1:ImageStudio000.lha \"%s\""
  116.                 @default-dest)
  117.             )
  118.         )
  119.  
  120.         ; Install the 68020 version
  121.  
  122.         (
  123.             (run ("ram:pcefis ImageStudio_1:ImageStudio020.lha \"%s\""
  124.                 @default-dest)
  125.             )
  126.         )
  127.  
  128.     )
  129.  
  130.     ; Install convolution filters
  131.  
  132.     (complete 30)
  133.  
  134.     (set convolvedir (tackon @default-dest "Convolves"))
  135.     (set doconvolve 1)
  136.  
  137.     (if (= 0 (exists convolvedir))
  138.         (
  139.             (makedir convolvedir
  140.                 (prompt "Creating 'Convolves' directory")
  141.                 (infos)
  142.             )
  143.         )
  144.  
  145.         ; Warn user about overwriting existing Convolves
  146.  
  147.         (
  148.             (if (askbool
  149.                 (prompt "Existing 'Convolves' directory found. "
  150.                     "Overwrite existing convolution filters?")
  151.                 (help "If you don't wish to overwrite your "
  152.                     "current convolution filters, skip this "
  153.                     "part of the installation process.")
  154.                 (choices "Yes" "Skip this part")
  155.                 )
  156.  
  157.                 ; If chosen overwrite
  158.  
  159.                 (
  160.                     (set doconvolve 1)
  161.                 )
  162.  
  163.                 ; If chosen skippy
  164.  
  165.                 (
  166.                     (set doconvolve 0)
  167.                 )
  168.             )
  169.         )
  170.     )
  171.  
  172.     (if doconvolve
  173.         (
  174.             (working "Decompressing convolution filters...")
  175.  
  176.             (run ("ram:pcefis ImageStudio_1:Convolves.lha \"%s\""
  177.                 convolvedir))
  178.         )
  179.     )
  180.  
  181.     ; Install palettes
  182.  
  183.     (complete 40)
  184.  
  185.     (set palettesdir (tackon @default-dest "Palettes"))
  186.     (set dopalettes 1)
  187.  
  188.     (if (= 0 (exists palettesdir))
  189.         (
  190.             (makedir palettesdir
  191.                 (prompt "Creating 'Palettes' directory")
  192.                 (infos)
  193.             )
  194.         )
  195.  
  196.         ; Warn user about overwriting existing Palettes
  197.  
  198.         (
  199.             (if (askbool
  200.                 (prompt "Existing 'Palettes' directory found. "
  201.                     "Overwrite existing palettes?")
  202.                 (help "If you don't wish to overwrite your "
  203.                     "current palettes, skip this "
  204.                     "part of the installation process.")
  205.                 (choices "Yes" "Skip this part")
  206.                 )
  207.  
  208.                 ; If chosen overwrite
  209.  
  210.                 (
  211.                     (set dopalettes 1)
  212.                 )
  213.  
  214.                 ; If chosen skippy
  215.  
  216.                 (
  217.                     (set dopalettes 0)
  218.                 )
  219.             )
  220.         )
  221.     )
  222.  
  223.     (if dopalettes
  224.         (
  225.             (working "Decompressing palettes...")
  226.  
  227.             (run ("ram:pcefis ImageStudio_1:Palettes.lha \"%s\""
  228.                 palettesdir))
  229.         )
  230.     )
  231.  
  232.     ; Install ARexx scripts
  233.  
  234.     (complete 50)
  235.  
  236.     (set rexxdir (tackon @default-dest "Rexx"))
  237.     (set dorexx 1)
  238.  
  239.     (if (= 0 (exists rexxdir))
  240.         (
  241.             (makedir rexxdir
  242.                 (prompt "Creating 'Rexx' directory")
  243.                 (infos)
  244.             )
  245.         )
  246.  
  247.         ; Warn user about overwriting existing Rexx scripts
  248.  
  249.         (
  250.             (if (askbool
  251.                 (prompt "Existing 'Rexx' directory found. "
  252.                     "Overwrite existing convolution filters?")
  253.                 (help "If you don't wish to overwrite your "
  254.                     "current ARexx scripts, skip this "
  255.                     "part of the installation process.")
  256.                 (choices "Yes" "Skip this part")
  257.                 )
  258.  
  259.                 ; If chosen overwrite
  260.  
  261.                 (
  262.                     (set dorexx 1)
  263.                 )
  264.  
  265.                 ; If chosen skippy
  266.  
  267.                 (
  268.                     (set dorexx 0)
  269.                 )
  270.             )
  271.         )
  272.     )
  273.  
  274.     (if dorexx
  275.         (
  276.             (working "Decompressing ARexx scripts...")
  277.  
  278.             (run ("ram:pcefis ImageStudio_1:Rexx.lha \"%s\""
  279.                 rexxdir))
  280.         )
  281.     )
  282.  
  283.     ; Ask whether should install demo pictures
  284.  
  285.     (complete 60)
  286.  
  287.     (set demopics
  288.         (askbool
  289.             (prompt "Do you want the demo pictures installed?")
  290.             (help "Installing the demo pics will allow you to perform "
  291.                 "some of the tutorials given in the documentation. "
  292.                 "All the demo pictures are small enough to load "
  293.                 "into the unregistered version of ImageStudio.")
  294.             (choices "Yes" "Skip this part")
  295.         )
  296.     )
  297.  
  298.     (if demopics
  299.         (
  300.             ; Create directory if needed
  301.  
  302.             (set picsdir (tackon @default-dest "Pics"))
  303.  
  304.             (if (= 0 (exists picsdir))
  305.                 (
  306.                     (makedir picsdir
  307.                         (prompt "Creating 'Pics' directory")
  308.                         (infos)
  309.                     )
  310.                 )
  311.             )
  312.  
  313.             ; Decompress the pics files
  314.  
  315.             (working "Decompressing demo pics...")
  316.  
  317.             (run ("ram:pcefis ImageStudio_1:Pics.lha \"%s\""
  318.                 picsdir))
  319.         )
  320.     )
  321.  
  322.     ; Copy the AmigaGuide.library if needed
  323.  
  324.     (complete 65)
  325.  
  326.     (working "Checking amigaguide.library version...")
  327.  
  328.     (copylib
  329.         (prompt "Copying amigaguide library to LIBS: directory...")
  330.         (help "The amigaguide.library is needed for online help. "
  331.             "Users of Workbench3.0 and above will have a more recent "
  332.             "version of this library and so can skip this part "
  333.             "of the installation.")
  334.         (source "ImageStudio_1:libs/amigaguide.library")
  335.         (dest "LIBS:")
  336.         (confirm)
  337.     )
  338.  
  339.     ; Copy keyfile if it exists
  340.  
  341.     (if (exists "ImageStudio_1:ImageStudio.keyfile")
  342.         (
  343.             (copyfiles
  344.                 (source "ImageStudio_1:ImageStudio.keyfile")
  345.                 (dest @default-dest)
  346.             )
  347.  
  348.             (set foundkeyfile (""))
  349.         )
  350.  
  351.         ; Else, note we didn't find one
  352.  
  353.         (
  354.             (set foundkeyfile (cat "No keyfile was found during "
  355.                 "installation. If you are a registered user make "
  356.                 "sure that you create a keyfile by selecting the "
  357.                 "'Create keyfile' option in the 'Project' menu "
  358.                 "of this version of ImageStudio. For more details "
  359.                 "see the 'Upgrading from v1.x.x' section in the "
  360.                 "'Introduction' of the manual."))
  361.         )
  362.     )
  363.  
  364.     ; Ask user what documentation the user wishes
  365.  
  366.     (set docchoice
  367.         (askoptions
  368.             (prompt "Which formats of documentation would you like "
  369.                 "installing in your 'Docs' directory?")
  370.             (help    "ImageStudio.txt is the ASCII (plain text) "
  371.                 "documentation file.\n\n"
  372.                 "ImageStudio.guide documentation is required for "
  373.                 "online help.\n\n"
  374.                 "ImageStudio.ps is the documentation in PostScript "
  375.                 "format.\n\n"
  376.                 "ImageStudio.dvi is for use with the Amiga TeX "
  377.                 "package.")
  378.             (choices "ImageStudio.txt" "ImageStudio.guide"
  379.                  "ImageStudio.ps" "ImageStudio.dvi")
  380.             (default 3)
  381.         )
  382.     )
  383.  
  384.     ; Create directory if needed
  385.  
  386.     (set docsdir (tackon @default-dest "Docs"))
  387.  
  388.     (if (= 0 (exists docsdir))
  389.         (
  390.             (makedir docsdir
  391.                 (prompt "Creating 'Docs' directory")
  392.                 (infos)
  393.             )
  394.         )
  395.     )
  396.  
  397.     ; Copy the readme, history and news files into the docs directory
  398.  
  399.     (complete 70)
  400.  
  401.     (copyfiles
  402.         (source "ImageStudio_1:")
  403.         (dest docsdir)
  404.         (choices "NEWS.txt" "HISTORY.txt" "README.txt")
  405.         (infos)
  406.     )
  407.  
  408.     ; See if we want to install the ImageStudio.txt doc
  409.  
  410.     (if (= 1 (IN docchoice 0))
  411.         (
  412.             (askdisk (dest "ImageStudio_2")
  413.             (prompt "Please insert disk ImageStudio_2")
  414.             (help "Insert Disk 2 in any drive. You may "
  415.                 "remove Disk 1, it will not be needed again."))
  416.  
  417.             (working "Decompressing ASCII documentation...")
  418.  
  419.             (run ("ram:pcefis ImageStudio_2:DocTXT.lha \"%s\""
  420.                 docsdir))
  421.         )
  422.     )
  423.  
  424.     ; See if we want to install the ImageStudio.guide doc
  425.  
  426.     (if (= 2 (IN docchoice 1))
  427.         (
  428.             (askdisk (dest "ImageStudio_2")
  429.             (prompt "Please insert disk ImageStudio_2")
  430.             (help "Insert Disk 2 in any drive. You may "
  431.             "remove Disk 1, it will not be needed again.") )
  432.  
  433.             (working "Decompressing AmigaGuide documentation...")
  434.  
  435.             (run ("ram:pcefis ImageStudio_2:DocGUIDE.lha \"%s\""
  436.                 docsdir))
  437.         )
  438.     )
  439.  
  440.     ; See if we want to install the ImageStudio.ps doc
  441.  
  442.     (if (= 4 (IN docchoice 2))
  443.         (
  444.             (askdisk (dest "ImageStudio_2")
  445.             (prompt "Please insert disk ImageStudio_2")
  446.             (help "Insert Disk 2 in any drive. You may "
  447.             "remove Disk 1, it will not be needed again.") )
  448.  
  449.             (working "Decompressing PostScript documentation...")
  450.  
  451.             (run ("ram:pcefis ImageStudio_2:DocPS.lha \"%s\""
  452.                 docsdir))
  453.         )
  454.     )
  455.  
  456.     ; See if we want to install the ImageStudio.dvi doc
  457.  
  458.     (if (= 8 (IN docchoice 3))
  459.         (
  460.             (askdisk (dest "ImageStudio_2")
  461.             (prompt "Please insert disk ImageStudio_2")
  462.             (help "Insert Disk 2 in any drive. You may "
  463.             "remove Disk 1, it will not be needed again.") )
  464.  
  465.             (working "Decompressing DVI documentation...")
  466.  
  467.             (run ("ram:pcefis ImageStudio_2:DocDVI.lha \"%s\""
  468.                 docsdir))
  469.         )
  470.     )
  471.  
  472.     ; Say goodbye
  473.  
  474.     (set endmessage (cat "Do not forget to set the value of the TEMPDIR "
  475.         "preference so that the virtual memory swap files can be created "
  476.         "on your hard disk instead of taking lots of RAM.\n\n"))
  477.  
  478.     (if (<> foundkeyfile "")
  479.         (
  480.             (set endmessage (cat endmessage foundkeyfile))
  481.         )
  482.     )
  483.  
  484.     (complete 100)
  485.  
  486.     (message endmessage)
  487.  
  488.     ; Cleanup
  489.  
  490.     (delete ("ram:LX"))
  491.     (delete ("ram:pcefis"))
  492. )
  493.